
#include "stdafx.h"
#include "MainDlg.h"

int APIENTRY _tWinMain(HINSTANCE hInstance,
					   HINSTANCE hPrevInstance,
					   LPTSTR    lpCmdLine,
					   int       nCmdShow)
{

	CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
	GetUIEngine()->InitSkin();

	tstring strPath = GetRunDir();
	strPath += L"skin\\";
	GetUIRes()->InitResDir(L"main", strPath.c_str());
	CMainDlg* pMainDlg = new CMainDlg;
	pMainDlg->SetAutoDel(false);
	pMainDlg->Create(NULL, _T("main"));
	pMainDlg->CenterWindow();
	pMainDlg->ShowWindow();
	pMainDlg->MaximizeWindow();
	GetUIEngine()->MessageLoop();
	delete pMainDlg;
	GetUIEngine()->UnInitSkin();
	::CoUninitialize();
	return 0;
}